home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / hack / 3_1_3 / sys / os2 / install.os2 next >
Encoding:
Text File  |  1993-04-30  |  14.8 KB  |  273 lines

  1.              Instructions for compiling and installing NetHack 3.1
  2.                                on an OS/2 system
  3.              =====================================================
  4.                                 Timo Hakulinen
  5.                           Last revision: 31 May 1993
  6.  
  7. 0.  Read this entire file before starting, and come back to the Notes below if
  8.     you have any problems.
  9.  
  10. 1.  Make sure all the NetHack files are in the appropriate directory
  11.     structure.  You should have a top directory (e.g. nh31, or whatever you
  12.     like) with subdirectories dat, doc, include, src, util, sys\share,
  13.     sys\os2, and win\tty.  You may have other subdirectories under sys and
  14.     win, but they will not affect compilation for an OS/2 system.  If you do
  15.     not follow this structure, the makefile will not function properly.  The
  16.     .c files for the main program belong in src, those for utility programs in
  17.     util, and OS/2-specific ones in sys\os2.  All the .h files belong in
  18.     include, the documentation in doc, and assorted data files in dat.  There
  19.     are also some necessary files in sys\share (pc*.c, random.c, dgn_*.*,
  20.     lev_*.*).  A more detailed explanation of the directory structure is found
  21.     in file Files, which should be in the top directory.
  22.  
  23.     If you downloaded or ftp'd the sources from a UNIX system, the lines may
  24.     end in UNIX-style newlines instead of the carriage return and line feed
  25.     pairs used by DOS and OS/2.  You'll have to convert them (with a utility
  26.     like Rahul Dhesi's "flip").  Also, every file should end with a carriage
  27.     return / line feed pair, because Microsoft C has had a habit of ignoring
  28.     the last line of each file otherwise.  Besides, even editing UNIX-style
  29.     files with DOS editors is often a royal pain.
  30.  
  31. 2.  The makefile for OS/2, Makefile.os2, is found in directory sys\os2.  Copy
  32.     it to directory src and rename it Makefile.  From now on, Makefile.os2
  33.     will be referred to as "the makefile" in this document.
  34.  
  35.     The makefile supports the following make utilities:
  36.  
  37.     NDMAKE      a public domain make utility for DOS by Don Kneller
  38.     NMAKE       make shipped with Microsoft languages and IBM C Set/2
  39.     DMAKE       a public domain make for DOS and OS/2 by Dennis Vadura
  40.  
  41.     Both NDMAKE and DMAKE are available at major archive sites.  The
  42.     following compilers are supported:
  43.  
  44.     compiler:                           runs in:            compiles for:
  45.  
  46.     Microsoft C 5.1                     DOS / OS/2 1.0-2.x  OS/2 1.x
  47.     Microsoft 6.0A (see note 5)         - " -               - " -
  48.     IBM C Set/2 1.00, Toolkit/2 2.00    OS/2 2.x            OS/2 2.x
  49.     GCC emx 0.8f (see note 6)           OS/2 2.x            OS/2 2.x
  50.  
  51.     Note that code compiled for OS/2 versions 1.0-1.3 runs unmodified in OS/2
  52.     versions 2.0 and up.  In principle it should be possible to cross compile
  53.     NetHack 3.1 for OS/2 in DOS using NDMAKE and MSC, but this is not
  54.     recommended (see note 3).
  55.  
  56.     If you're using some other compiler than one listed above, you will have
  57.     to adapt the makefile to your needs.  In particular, change the CC,
  58.     CFLAGS, LINK, and LFLAGS macros to your C compiler's and linker's liking.
  59.     See the makefile for more information.
  60.  
  61.     If you are going to be constructing Fred Fish's termcap library, you'll
  62.     need Makefile.lib in sys\share (see note 4).
  63.  
  64. 3.  Go to the include subdirectory.  First edit config.h according to the
  65.     comments to match your system and desired set of features.  In particular,
  66.     make sure that OS2 is defined, and that UNIX, HACKDIR, and COMPRESS are
  67.     *not* defined.  If your compiler is ANSI compliant (like practically all
  68.     OS/2 compilers are), it's probable that nothing else needs to be
  69.     configured in config.h.  However, if you have VISION_TABLES defined and
  70.     get a compilation error while processing vis_tab.c, you may have to
  71.     uncomment BRACES too.
  72.  
  73.     Next look at os2conf.h.  This file shouldn't need much changing.  If you
  74.     want to use the hardcoded OS/2 system definitions in def_os2.h instead of
  75.     the compiler's standard headers, comment out OS2_USESYSHEADERS.  This may
  76.     become necessary if you are using a compiler which doesn't come with
  77.     proper system headers by default.  In this case you may have to edit the
  78.     definitions there, because every compiler has its own way of declaring
  79.     the necessary system functions and data structures.  In general you
  80.     should prefer the compiler's offerings, if possible.
  81.  
  82.     If you are going to compile the game on an HPFS drive, uncomment OS2_HPFS,
  83.     which enables the use of longer file names during compilation.  The
  84.     generated executable will only use file names compatible with FAT drives,
  85.     however.
  86.  
  87.     If you are using a 32 bit compiler other than GCC emx 0.8f or C Set/2 in
  88.     OS/2 2.x, force OS2_32BITAPI to be defined.  Otherwise it is defined only
  89.     for the above mentioned compilers.
  90.  
  91.     If you are not going to include random.c, because you are using the
  92.     random number generator provided by your compiler, you will need to
  93.     comment out RANDOM.
  94.  
  95.     If you want to muck with different termcap settings, uncomment TERMLIB to
  96.     enable the use of termcap routines (see note 4).  This is not necessary to
  97.     create a fully functional game, however.
  98.  
  99. 4.  If you are using another compiler than MSC, GCC, or IBM C Set/2, you may
  100.     want to look through system.h in the include directory.  This file matches
  101.     the return and parameter types for system calls and library routines with
  102.     various flavors of compilers and operating systems.  Leaving this file
  103.     alone is unlikely to cause problems, but if you get compile errors with
  104.     any functions in the standard library, it's worth checking the
  105.     declarations there.
  106.  
  107. 5.  If you want to change the high score list behavior, examine the top of
  108.     topten.c, in the src directory.  You may want to change the definitions of
  109.     PERSMAX, POINTSMIN, and ENTRYMAX.
  110.  
  111. 6.  Go to the src directory and edit the top of the makefile.  Be sure that
  112.     the directory you want the game installed to actually exists.
  113.  
  114.     You'll need nroff and/or TeX/LaTeX to do the files in doc.  If you don't
  115.     have either of these, you can skip it.
  116.  
  117.     If you elected not to use the high quality BSD random number routines by
  118.     commenting out RANDOM in os2conf.h, comment out (or set equal to nothing)
  119.     the RANDOM macro in the makefile.
  120.  
  121.     If you elected to use Fred Fish's termcap library (bundled in as
  122.     termcap.uu in directory sys\share), you will have to generate termlib.lib
  123.     from those sources by typing "make -f makefile.lib termlib.lib".  You must
  124.     set the TERMLIB option in the makefile to link the resulting termlib.lib
  125.     into the game.
  126.  
  127.     If you are recompiling after patching your sources, or if you got your
  128.     files from somewhere other than the official distribution, "touch
  129.     makedefs.c" to ensure that certain files (onames.h and pm.h) are remade,
  130.     lest potentially troublesome time stamps fool make.
  131.  
  132.     If you have lex and yacc programs, or the equivalent flex and bison
  133.     programs, you can set up the makefile to generate the appropriate .h and
  134.     .c files from their .l and .y counterparts whenever you recompile.  This
  135.     is done by changing the do_yacc and do_lex targets in the makefile to
  136.     depend on targets yacc_act and lex_act instead of yacc_cpy and lex_cpy.
  137.     Otherwise the makefile will copy pre-generated yacc and lex output files
  138.     dgn_*.* and lev_*.* from directory sys\share to util and include.
  139.  
  140.     Now, enter "make all", and take a siesta; your computer will be occupied
  141.     for a fair amount of time.  If all goes well, you will get an executable.
  142.  
  143. 7.  All the support data files should have been copied to the game directory
  144.     by the make process.  Here is the complete list in alphabetical order of
  145.     all the files that should have gotten there during a full build:
  146.  
  147.     A-filla.lev    A-fillb.lev    A-goal.lev     A-locate.lev   A-start.lev
  148.     B-filla.lev    B-fillb.lev    B-goal.lev     B-locate.lev   B-start.lev
  149.     C-filla.lev    C-fillb.lev    C-goal.lev     C-locate.lev   C-start.lev
  150.     E-filla.lev    E-fillb.lev    E-goal.lev     E-locate.lev   E-start.lev
  151.     H-filla.lev    H-fillb.lev    H-goal.lev     H-locate.lev   H-start.lev
  152.     K-filla.lev    K-fillb.lev    K-goal.lev     K-locate.lev   K-start.lev
  153.     P-filla.lev    P-fillb.lev    P-goal.lev     P-locate.lev   P-start.lev
  154.     R-filla.lev    R-fillb.lev    R-goal.lev     R-locate.lev   R-start.lev
  155.     S-filla.lev    S-fillb.lev    S-goal.lev     S-locate.lev   S-start.lev
  156.     T-filla.lev    T-fillb.lev    T-goal.lev     T-locate.lev   T-start.lev
  157.     V-filla.lev    V-fillb.lev    V-goal.lev     V-locate.lev   V-start.lev
  158.     W-filla.lev    W-fillb.lev    W-goal.lev     W-locate.lev   W-start.lev
  159.     air.lev        asmodeus.lev   astral.lev     baalz.lev      bigroom.lev
  160.     castle.lev     cmdhelp        data           dungeon        earth.lev
  161.     fakewiz1.lev   fakewiz2.lev   fire.lev       help           hh
  162.     history        juiblex.lev    knox.lev       license        medusa-1.lev
  163.     medusa-2.lev   mine_end.lev   minefill.lev   minetown.lev   nethack.cmd
  164.     nethack.cnf    nethack.exe    nethack.ico    opthelp        options
  165.     oracle.lev     oracles        orcus.lev      quest.dat      recover.exe
  166.     rumors         sanctum.lev    tower1.lev     tower2.lev     tower3.lev
  167.     valley.lev     water.lev      wizard1.lev    wizard2.lev    wizard3.lev
  168.     wizhelp
  169.  
  170.     Yes.  It's 106 files for a full featured NetHack 3.1.  If any of the files
  171.     are missing, try to rerun make.  If that doesn't help, you'll have to try
  172.     to decipher the makefile to find out how to manually create the missing
  173.     files.  These kinds of troubles shouldn't happen except for two reasons:
  174.     You've run out of disk space while compiling or your make utility doesn't
  175.     understand the makefile properly for some reason.  In either case, you
  176.     should get some warnings from the make, though.
  177.  
  178.     If you have old record, logfile, or news files in the game directory, they
  179.     are not overwritten.  Of course, old records from NetHack 3.0 are not
  180.     worth keeping with 3.1, since these games are really quite different.
  181.  
  182.     Edit file nethack.cnf in the game directory to reflect your particular
  183.     setup and personal preferences, following the comments there.  More info
  184.     about settable options can be found in the file opthelp and the guidebook.
  185.  
  186.     If you compiled in the TERMLIB feature, also move the sys\share\termcap
  187.     file to your game directory.
  188.  
  189. 8.  If you'll be running NetHack from a different subdirectory, you will want
  190.     to "set HACKDIR=c:\games\nh31" (or whatever directory you want to use).
  191.     Add it to your config.sys, if you'll be playing often.
  192.  
  193.     You can also create a special NetHack entry in your Presentation Manager /
  194.     Workplace Shell desktop.  This will use the included NetHack icon.
  195.     The following is a sample program description for OS/2 1.3 desktop, but
  196.     it's similar for OS/2 2.0:
  197.  
  198.     Program title:          NetHack 3.1
  199.     Path and file name:     c:\games\nh31\nethack.cmd
  200.     Parameters:
  201.     Working directory:      c:\games\nh31
  202.     Program type:           OS/2 Full screen
  203.  
  204.     Naturally you must fill in your own game directory and parameters if you
  205.     want to set any.  The program type can be either OS/2 Full screen or OS/2
  206.     Windowed.  Note that you should set the executable path to use the .cmd
  207.     file generated by the makefile.  This file generates an extra pause after
  208.     the program exit, because otherwise you wouldn't get to see the high score
  209.     list upon quitting due to PM/WPS automatically closing the program window.
  210.     When starting NetHack normally from OS/2 command prompt, the command
  211.     processor starts nethack.exe instead, so no extra pause is generated.
  212.  
  213. 9.  If you want to clear up the temporary files and objects created by the
  214.     compilation process, you may issue "make spotless".  This will return your
  215.     source tree to near-distribution condition.  Naturally, it will not affect
  216.     your newly built game files in any way.
  217.  
  218. 10. Play NetHack.  If it works, you're done!
  219.  
  220.  
  221. Notes
  222. -----
  223.  
  224. 1)  Save-files and bones-files from previous versions will not work with
  225.     NetHack 3.1.  Don't bother trying to keep them.
  226.  
  227. 2)  To install an update of NetHack after changing something, enter "make"
  228.     from the src directory.  If you add, delete, or reorder monsters or
  229.     objects, or you change the format of saved level files, delete any save
  230.     and bones files.  (Trying to use such files sometimes produces amusing
  231.     confusions on the game's part, but usually crashes.)
  232.  
  233. 3)  When cross-compiling for OS/2 in DOS, NDMAKE is the best choice because it
  234.     requires the least RAM for itself.  Note however, that cross-compilation
  235.     in DOS is discouraged, because it is considered obsolete (OS/2 is really
  236.     a much better place to compile).  If you still want to try, here are some
  237.     suggestions:
  238.  
  239.     During linking, Microsoft linker will need temporary storage space.  Make
  240.     sure you have about 1 MB of free disk where ever you have defined your
  241.     temporary storage.  It is also a good idea to compile with as much free
  242.     RAM as possible.  It may otherwise get crowded with the bigger, more
  243.     complex source files (compiler bombs with "out of heap space" or similar).
  244.     If this happens, strip your configuration, zap TSR's, get a better memory
  245.     manager etc.
  246.  
  247. 4)  The file sys\share\termcap.uu is the fixed version of the Fred Fish
  248.     termcap library.  You will need to run a uudecode utility on it to
  249.     generate the file termcap.zip.  termcap.zip contains several files of
  250.     termcap routines.  Using them with NetHack involves very little knowledge
  251.     of the UNIX concept of a termcap database; mostly you need to know enough
  252.     to set a TERM environment variable.  You can unzip termcap.zip in the
  253.     sys\share directory, but if you are going to use it, it is probably best
  254.     to unzip a copy in the src directory.  That way you will not miss copying
  255.     any files over.  Wherever you unzip it, get rid of the included makefile
  256.     since a better version has been provided as Makefile.lib.  After creating
  257.     the termcap library file termlib.lib, copy it to src before compiling the
  258.     game main source.
  259.  
  260. 5)  When compiling with MSC 6.0, the maintenance version 6.0A should be used
  261.     instead of the original 6.0, which was all too buggy to successfully build
  262.     NetHack 3.1.
  263.  
  264. 6)  Note that emx 0.8f is the first version of GCC for OS/2 that can properly
  265.     compile NetHack.  Earlier versions do not work, because they don't support
  266.     the 16 bit API calls of OS/2.
  267.  
  268.     GCC emx 0.8f does not currently work properly when fseek() function is
  269.     used with text files.  This is well documented in the compiler's
  270.     documentation.  Unfortunately NetHack uses fseek() in several places in
  271.     connection with text data.  This means that some help texts may not come
  272.     out right, but no serious problems should emerge.
  273.